package org.hs.im.forensicj.view.imageviewer.action;

import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;

import javax.swing.KeyStroke;

import org.hs.im.forensicj.Resources;
import org.hs.im.forensicj.view.ImageViewer;

import bibliothek.gui.dock.common.action.CButton;

public class UndoButton extends CButton {

	private ImageViewer viewer;

	public UndoButton(ImageViewer viewer) {
		this.viewer = viewer;
		setText( "Undo" );
		setIcon( Resources.getIcon( "imageviewer.undo" ) );
		setAccelerator( KeyStroke.getKeyStroke( KeyEvent.VK_Z, InputEvent.CTRL_MASK ) );
	}

	@Override
	protected void action() {
		viewer.undo();
	}

}
